<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>商品列表页</title>

</head>
<body>
	<%@ include file="header.jsp"%>
	
   
<div class="panel panel-default" style="margin: 0 auto;width: 95%;">
	<div class="panel-heading">
	    <h3 class="panel-title"><span class="glyphicon glyphicon-th-list"></span>&nbsp;&nbsp;商品列表</h3>
	</div>
	<div class="panel-body">
	   	   <!--列表开始-->
	    <div class="row" style="margin: 0 auto;">
	    	<c:forEach items="${pageBean.list}" var="g" varStatus="i">
		    	<div class="col-sm-3">
				    <div class="thumbnail">
				      <img src="${pageContext.request.contextPath}/image/${g.gImg}" width="180" height="180"  alt="${g.gName}" />
				      <div class="caption">
				        <h4>商品名称<a href="${pageContext.request.contextPath}/goods/detail?gId=${g.gId}">${g.gName}</a></h4>
				        <p>热销指数
				        	<c:forEach begin="1" end="${g.gRank}">
				        		<img src="${pageContext.request.contextPath}/image/star_red.gif" alt="star"/>
				        	</c:forEach>
				        </p>
				         <p>上架日期:${g.gDate}</p>
			             <p style="color:orange">价格:${g.gPrice}</p>
				      </div>
				    </div>
				  </div>
	    	</c:forEach>

		</div>

		<div>
				<nav aria-label="Page navigation">
					<ul class="pagination">
						<li class="${pageBean.page == 1?'disabled':''}">
							<a  href="${pageContext.request.contextPath}/goods/show?page=${pageBean.page-1}&key=${pageBean.key}&cId=${pageBean.cId}" aria-label="Previous">
								<span aria-hidden="true">&laquo;</span>
							</a>
						</li>

						<c:forEach var="index" begin="1" end="${pageBean.totalPage}" step="1">

							<li class="${pageBean.page == index?'active':''}">
								<a  href="${pageContext.request.contextPath}/goods/show?page=${index}&key=${pageBean.key}&cId=${pageBean.cId}">${index}</a></li>

						</c:forEach>


						<li class="${pageBean.page == pageBean.totalPage?'disabled':''}">
							<a  href="${pageContext.request.contextPath}/goods/show?page=${pageBean.page+1}&key=${pageBean.key}&cId=${pageBean.cId}" aria-label="Next">
								<span aria-hidden="true">&raquo;</span>
							</a>
						</li>
					</ul>
				</nav>
		</div>
   	</div>
</div>
      <!-- 底部 -->
   <%@ include file="footer.jsp"%>
</body>
</html>